package com.project.demo.controller;

import com.project.demo.entity.Affairs;
import com.project.demo.entity.Satisfied;
import com.project.demo.mapper.AffairsMapper;
import com.project.demo.mapper.SatisfiedMapper;
import com.project.demo.vo.AffairsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SatisfiedController {
    @Autowired(required = false)
    SatisfiedMapper satisfiedMapper;

    @RequestMapping("/showsatisfied")
    public AffairsVo showsatisfied(){
        List<Satisfied> satisfieds = satisfiedMapper.selectList(null);
        AffairsVo affairsVo=new AffairsVo();
        affairsVo.setCode(0);
        affairsVo.setData(satisfieds);
        affairsVo.setMsg("");
        affairsVo.setCount(satisfieds.size());
        return  affairsVo;
    }

}
